﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace NetJsWire.Widgets.Converters
{
    internal class ControlTypeConverter : TypeConverter
    {
        public override bool CanConvertFrom( ITypeDescriptorContext context, Type sourceType )
        {
            return true;
        }

        public override bool CanConvertTo( ITypeDescriptorContext context, Type destinationType )
        {
            return true;
        }

        public override bool GetPropertiesSupported( ITypeDescriptorContext context )
        {
            return true;
        }

        public override PropertyDescriptorCollection GetProperties( ITypeDescriptorContext context, object value, Attribute[] attributes )
        {
            var list = base.GetProperties( context, value, attributes );
            list.Remove( list[ "BackColor" ] );
            list.Remove( list[ "BorderStyle" ] );
            list.Remove( list[ "CausesValidation" ] );
            list.Remove( list[ "ContextMenuStrip" ] );
            return list;
        }
    }
}
